package com.hamster.crmpre.web;

import com.hamster.crmpre.config.LoginInterceptor;
import com.hamster.crmpre.pojo.ManagerPerformance;
import com.hamster.crmpre.service.ManagerPerformanceService;
import com.hamster.crmpre.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：Lizhipeng
 * @date ：Created in 2020/1/6 11:04
 * @description：经理业绩
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("managerPerformance")
public class ManagerPerformanceController {

    @Autowired
    private ManagerPerformanceService managerPerformanceService;

    @GetMapping("list")
    public ResponseEntity<List<ManagerPerformance>> list() {
        String userId = LoginInterceptor.getLoginUser().getUserId();
        List<ManagerPerformance> managerPerformanceList = managerPerformanceService.list(userId);
        return ResponseEntity.ok(managerPerformanceList);
    }
}
